﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Linq;
using System.Text;
using RN.ERP.DTO;
using RN.ERP.DAL.Context;
using Fly.Log;
using RN.ERP.Entity.ResultModels;
using Fly.Common.WorkFlow;

namespace RN.ERP.BLL
{
    public abstract partial class BaseEnterpriseBLL : IBll
    {
        protected DbContext baseContext;

        #region 查询
        public virtual bool IsOrgnizationCodeExists(string orgnizationCode, string corpType, string areaCode)
        {
            return false;
        }

        public virtual string GetCorpQualityItems(string corpType, string areaCode)
        {
            return string.Empty;
        }

        public virtual string GetCorpInfo(string corpUserGuid, string areaCode)
        {

            return string.Empty;
        }
        public virtual List<tb_Corp_CompanyInfo_wdrq> GetCorpInfoWdrq(string corpUserGuid, string areaCode)
        {
            return null;
        }

        public virtual string GetCorpQualities(string corpUserGuid, string areaCode)
        {
            return string.Empty;
        }

        public virtual IList<Entity.QD.tb_Corp_Quality> GetCorpQualitiesByConditon(string condition, string areaCode)
        {
            return null;
        }

        public virtual string GetCorpQuality(string qualityId, string areaCode)
        {
            return string.Empty;
        }

        public virtual string GetCorpSecurity(string corpUserGuid, string areaCode)
        {
            return string.Empty;
        }

        public virtual IList<DTO.Kh_CorpTable> GetCorpSecurityList(string queryCondition, int pageSize, int pageNum, string areaCode, out int count)
        {
            count = 0;
            return null;
        }

        public virtual string GetCorpKind(string corpkind, string areaCode)
        {
            return string.Empty;
        }

        public virtual string GetQualityGrade(string dicquery, string areaCode)
        {
            return string.Empty;
        }

        /// <summary>
        /// 获取企业列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="condition"></param>
        /// <returns></returns>
        public virtual string GetCorpInfos(string condition, string areaCode)
        {
            return string.Empty;
        }

        /// <summary>
        /// 获取企业列表记录数
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="condition"></param>
        /// <returns></returns>
        public virtual int GetCorpInfosCount(int pageIndex, int pageSize, string condition, string areaCode)
        {
            return -1;
        }

        public virtual string GetCorpOuterPrize(string condition, int pageIndex, int pageSize, string areaCode)
        {
            return string.Empty;
        }
        public virtual string GetCorpProjectPrizePunish(string condition, int pageIndex, int pageSize, string areaCode)
        {
            return string.Empty;
        }
        public virtual string GetCorpPrizePunish(string condition, int pageIndex, int pageSize, string areaCode)
        {
            return string.Empty;
        }

        public virtual string GetCorpOuterPrizeCount(string condition, string areaCode)
        {
            return string.Empty;
        }
        public virtual string GetCorpProjectPrizePunishCount(string condition, string areaCode)
        {
            return string.Empty;
        }
        public virtual string GetCorpPrizePunishCount(string condition, string areaCode)
        {
            return string.Empty;
        }

        /// <summary>
        /// 本市、外埠市场[招标代理] 工程详细信息
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public virtual string GetOuterPrizeProjectInfoByID(string ID, string areaCode)
        {
            return string.Empty;
        }

        /// <summary>
        /// 查询e_FlowTable的历史记录
        /// </summary>
        /// <returns></returns>
        public virtual string GetAuditHistory(string condition, string areaCode)
        {
            return string.Empty;
        }

        public virtual string GetCorpOuerPrizeAllProjectByCorpGuid(string condition, string areaCode)
        {
            return string.Empty;
        }
        public virtual string GetProjectPrizePunishInfoByID(string ID, string areaCode)
        {
            return string.Empty;
        }

        public virtual string GEtCheckTitleByKHID(string KHID, string areaCode)
        {
            return string.Empty;
        }

        public virtual string GetProjectPrizePunishByCorpGuid(string KHID, string areaCode)
        {
            return string.Empty;
        }

        public virtual string GetPrizePunishInfoByID(string ID, string areaCode)
        {
            return string.Empty;
        }
        public virtual string GetPrizePunishByCorpGuid(string condition, string areaCode)
        {
            return string.Empty;
        }
        #endregion

        #region 企业端、主管端企业资质:注册添加、修改、查询、上报、审核
        /// <summary>
        /// 验证企业是否存在在建项目
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <returns></returns>
        public virtual string CheckCorp(string dogId, string areaCode)
        {
            return string.Empty;
        }
        /// <summary>
        /// 根据企业Guid验证企业是否存在在建项目
        /// </summary>
        /// <param name="corpGuid"></param>
        /// <returns></returns>
        public virtual string CheckCorpByCorpGuid(string corpGuid, string areaCode)
        {
            return string.Empty;
        }

        /// <summary>
        /// 企业端:企业注册
        /// </summary>
        /// <param name="corpInfo"></param>
        /// <param name="userInfo"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CorpRegister(Tb_Corp_CompanyInfo corpInfo, T_Sys_Users userInfo, bool isReturnModel, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 企业端:企业注册信息上报（含企业内人员及资质）
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="isPostEmp"></param>
        /// <param name="isPostQuality"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CorpPost(string corpUserGuid, bool isPostEmp, bool isPostQuality, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 安全生产许可证信息上报
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="isPostEmp"></param>
        /// <param name="isPostQuality"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult KH_CorpPost(string corpUserGuid, bool isPostEmp, bool isPostQuality, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 企业取消上报。
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="cancelReason"></param>
        /// <param name="areacode"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CorpCancelPost(string corpUserGuid, string cancelReason, string areacode)
        {
            return null;
        }

        public virtual string GetCorpostStatus(Guid corpuserguid, string areaCode)
        {
            return string.Empty;
        }

        /// <summary>
        /// 企业端:企业基本信息变更
        /// </summary>
        /// <param name="corpInfo"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CorpInfoEdit(Tb_Corp_CompanyInfo corpInfo, Kh_CorpTable khCorpTable, tb_Corp_CompanyInfo_wdrq wdrq, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 企业端:企业添加资质
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="qualities"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CorpQualityAdd(string corpUserGuid, IList<tb_Corp_Quality> qualities, bool isReturnModel, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 修改企业资质
        /// </summary>
        /// <param name="quality"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CorpQualityEdit(tb_Corp_Quality quality, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 删除企业资质
        /// </summary>
        /// <param name="qualityGuid"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CorpQualityDel(string qualityGuid, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 企业端:企业资质上报
        /// </summary>
        /// <param name="qualityGuid"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CorpQualityPost(IList<string> qualityGuid, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 主管端:主管审核企业上报的注册信息(多个)
        /// </summary>
        /// <param name="corpUserGuids"></param>
        /// <param name="log"></param>
        /// <param name="flowCode"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CorpListAudit(IList<string> corpUserGuids, User_Log log, string flowCode, bool isunlockandback, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 主管端:主管审核企业上报的注册信息
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="areaCode"></param>
        /// <param name="log"></param>
        /// <param name="flowCode"></param>
        /// <param name="isFinal"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CorpAudit(string corpUserGuid, string areaCode, User_Log log, string flowCode, string description, bool isFinal)
        {
            return null;
        }

        /// <summary>
        /// 主管端:主管审核企业上报的安全生产许可证信息
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="areaCode"></param>
        /// <param name="log"></param>
        /// <param name="flowCode"></param>
        /// <param name="description"></param>
        /// <param name="isFinal"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CorpSafeAudit(string corpUserGuid, string areaCode, User_Log log, string flowCode, string description, bool isFinal)
        {
            return null;
        }

        /// <summary>
        /// 主管端:主管审核企业的资质
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="areaCode"></param>
        /// <param name="log"></param>
        /// <param name="flowCode"></param>
        /// <param name="isFinal"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CorpQualityAudit(string corpUserGuid, string areaCode, User_Log log, string flowCode, bool isFinal)
        {
            return null;
        }

        /// <summary>
        /// 主管端:主管审核企业的资质
        /// </summary>
        /// <param name="qualities"></param>
        /// <param name="areaCode"></param>
        /// <param name="log"></param>
        /// <param name="flowCode"></param>
        /// <param name="isFinal"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CorpQualityAuditByQualities(IList<string> qualities, string areaCode, User_Log log, string flowCode, bool isFinal)
        {
            return null;
        }

        /// <summary>
        /// 公共:查询企业信息列表
        /// </summary>
        /// <param name="pageCount"></param>
        /// <param name="pageSize"></param>
        /// <param name="conditions"></param>
        /// <returns></returns>
        public virtual IList<Tb_Corp_CompanyInfo> GetCompaniesInfo(string conditions, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 公共:查询企业详细信息
        /// </summary>
        /// <param name="conditions"></param>
        /// <returns></returns>
        public virtual Tb_Corp_CompanyInfo GetCompanyInfo(string conditions, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 公共:查询企业资质
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="conditions"></param>
        /// <returns></returns>
        public virtual IList<tb_Corp_Quality> GetCompanyQualities(string corpUserGuid, string conditions, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 公共:查询企业资质
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="conditions"></param>
        /// <returns></returns>
        public virtual IList<tb_Corp_Quality> GetCompanyQualities1(string corpUserGuid, string conditions, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 公共:查询操作日志记录
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="functionId"></param>
        /// <param name="functionType"></param>
        /// <param name="objectId"></param>
        /// <param name="isrtUser"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <returns></returns>
        public virtual IList<User_Log> GetUserLog(string objectId, string codeType, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 公共:根据企业组织机构代码查询企业占用情况
        /// CorpRegisterValidationModel类包含bool的是否已注册，如果已经注册则包含Tb_Corp_CompanyInfo信息，和string的说明信息。
        /// </summary>
        /// <param name="corpCode"></param>
        /// <returns></returns>
        public virtual DTO.CorpRegisterValidationModel CorpRegisterValidate(string corpCode, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 公共:查询企业审核信息列表
        /// </summary>
        /// <param name="pageCount"></param>
        /// <param name="pageSize"></param>
        /// <param name="conditions"></param>
        /// <returns></returns>
        public virtual List<Tb_Corp_CompanyInfo1> GetFlowCorpInfos(int pageIndex, int pageSize, string condition, out int counts, string areaCode)////Tb_Corp_CompanyInfo1
        {
            counts = 0;
            return null;
        }

        public virtual List<Tb_Corp_CompanyInfo> GetFlowCorpInfosSystem2(int pageIndex, int pageSize, string condition, out int counts, string areaCode)
        {
            counts = 0;
            return null;
        }

        public virtual DTO.OperationResult CorpInfoWDRQEdit(string corpUserGuid, tb_Corp_CompanyInfo_wdrq wdrq, string areaCode)
        {
            return null;
        }
        #endregion

        #region 企业解锁、加锁 作者：
        public virtual bool LockCorpBCanBid(string corpGuid, string areaCode)
        {
            return false;
        }
        public virtual bool UnLockCorpBCanBid(string corpGuid, string areaCode)
        {
            return false;
        }
        #endregion

        #region 企业产量、产值、税金相关

        /// <summary>
        /// 根据年份查询企业是否有产量、产值、税金信息
        /// </summary>
        /// <param name="userGUID">企业GUID</param>
        /// <param name="year">年份</param>
        /// <param name="month">月份</param>
        /// <returns></returns>
        public virtual bool ExistsProfix(string userGUID, int year, int month, string areaCode)
        {
            return false;
        }

        /// <summary>
        /// 同时添加一个企业某一年的产量，产值，税金记录
        /// </summary>
        /// <param name="year">年</param>
        /// <param name="userGUID">userGUID</param>
        /// <param name="dogID">dogID</param>
        /// <param name="corpName">企业名称</param>
        /// <returns></returns>
        public virtual bool AddList(string year, string userGUID, string dogID, string corpName, string areaCode)
        {
            return false;
        }

        /// <summary>
        /// 企业端获取企业产值、税金信息
        /// </summary>
        /// <param name="userGUID">企业GUID</param>
        /// <param name="year">年份</param>
        /// <param name="month">月份</param>
        /// <param name="flowCode">审核状态</param>
        /// <returns></returns>
        public virtual List<DTO.Tb_Corp_ProfitTotal> GetListByYearUserGUID(string userGUID, int year, int month, string flowCode, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 添加企业产值、税金信息
        /// </summary>
        /// <param name="DTOProfit">序列化DTO实体</param>
        /// <returns></returns>
        public virtual DTO.OperationResult AddProfit(Tb_Corp_ProfitTotal Profit, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 根据ID获取企业产值、税金信息
        /// </summary>
        /// <param name="profitID">产值、税金ID</param>
        /// <returns></returns>
        public virtual DTO.Tb_Corp_ProfitTotal GetProfitByID(int profitID, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 根据ID(多个)删除企业产值、税金信息
        /// </summary>
        /// <param name="profitID">产值、税金ID</param>
        /// <returns>>返回序列化DTO.OperationResult结果</returns>
        public virtual DTO.OperationResult DeleteProfitByIDS(string profitID, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 修改企业产值、税金信息
        /// </summary>
        /// <param name="DTOprofit">序列化DTO实体</param>
        /// <returns>>返回序列化DTO.OperationResult结果</returns>
        public virtual DTO.OperationResult UpdateProfitByID(Tb_Corp_ProfitTotal DTOprofit, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 企业上报税金数据
        /// </summary>
        /// <param name="profitID">产值、税金ID</param>
        /// <returns>>返回序列化DTO.OperationResult结果</returns>
        public virtual DTO.OperationResult SBProfitByIDS(string profitID, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 主管审核企业产值、税金信息
        /// </summary>
        /// <param name="profitID">产值、税金ID</param>
        /// <param name="type">1：审核，2：退回</param>
        /// <param name="checkMemo">审核意见</param>
        /// <returns>>返回序列化DTO.OperationResult结果</returns>
        public virtual DTO.OperationResult CheckProfitByIDS(string profitID, int type, string checkMemo, bool isunlockandback, string areaCode)
        {
            return null;
        }



        /// <summary>
        /// 主管端获取企业产值、税金信息
        /// </summary>
        /// <param name="corpName">企业名称</param>
        /// <param name="year">年份</param>
        /// <param name="month">月份</param>
        /// <param name="flowCode">审核状态</param>
        /// <returns></returns>
        public virtual List<Tb_Corp_ProfitTotal> GetProfitListForManager(string corpUserGuid, string corpName, int year, int month, string flowCode, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 批量更新
        /// </summary>
        /// <param name="list">集合</param>
        /// <returns></returns>
        public virtual bool UpdateInfoTotalList(List<Tb_Corp_ProfitTotal> list, string areaCode)
        {
            return false;
        }

        /// <summary>
        /// 主管查询企业的产量，产值，税金信息
        /// </summary>
        /// <param name="year">年份</param>
        /// <param name="corpName">企业名称</param>
        /// <param name="areaCode">地区</param>
        /// <param name="flowState">审核状态：已审核、未审核</param>
        /// <returns></returns>
        public virtual List<DTO.Tb_Corp_ProfitTotal> GetListForManager(string year, string corpName, string areaCode, string flowState)
        {
            return null;
        }

        public virtual List<RN.ERP.Entity.QD.tb_Corp_ProfitTotal_GetMonthProfitTotalStat> GetProfitGuidListForManager(string corpName, int year, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 主管批量审核
        /// </summary>
        /// <param name="list">由userGUID、年份组成的键值对集合</param>
        /// <param name="ActionType">用户执行的操作：1代表审核，2代表退回，3代表弃审</param>
        /// <returns></returns>
        public virtual bool CheckProfit(List<string> list, int ActionType, string areaCode)
        {
            return false;
        }

        #endregion

        #region 工程业绩列表

        /// <summary>
        /// 主管端获取工程业绩列表
        /// </summary>
        /// <param name="corpName">企业名称</param>
        /// <param name="projectName">工程名称</param>
        /// <param name="flowCode">审核状态</param>
        /// <returns></returns>
        public virtual List<DTO.e_OuterPrize> GetProjectYJListForManager(string corpName, string projectName, string flowCode, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 企业端获取工程业绩列表
        /// </summary>
        /// <param name="corpUserGUID">企业名称GUID</param>
        /// <param name="year">年份</param>
        /// <param name="month">月份</param>
        /// <param name="flowCode">审核状态</param>
        /// <returns></returns>
        public virtual List<DTO.e_OuterPrize> GetProjectYJListForCorp(string corpUserGUID, string projectName, string flowCode, string areaCode)
        {
            return null;
        }

        /// <summary>
        /// 企业端删除工程
        /// </summary>
        /// <param name="ID">工程ID</param>
        /// <returns></returns>
        public virtual DTO.OperationResult DelProjectYJByIDS(string ID, string areaCode)
        {
            return null;
        }

        #endregion

        #region 业绩申报：添加，修改，审核，上报

        /// <summary>
        /// 业绩资质
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public virtual string GetQualityByOuterPrizeID(string id, string areaCode)
        {
            return string.Empty;
        }

        public virtual string CodeZjjg_bind(string areaCode)
        {
            return string.Empty;
        }
        public virtual string BindStructKind(string areaCode)
        {
            return string.Empty;
        }

        #endregion

        #region 企业资质判断

        public virtual DTO.OperationResult CheckCorpQuality(string dogId, string objStr, string areaCode)
        {
            DTO.OperationResult result = new DTO.OperationResult();

            this.baseContext = new ZBDL_Context();
            var dbUsers = ((ZBDL_Context)this.baseContext).T_Sys_Users;
            var dbCorpInfo = ((ZBDL_Context)this.baseContext).Corp_CompanyInfos;
            var dbQualities = ((ZBDL_Context)this.baseContext).Corp_CompanyQualities;
            var caCert = ((ZBDL_Context)this.baseContext).caCert;

            int keyNo = 0;
            int.TryParse(dogId, out keyNo);
            var user = dbUsers.Where(u => u.DogID == keyNo && u.DogID > 0).FirstOrDefault();
            if (user == null)
            {
                var corpGuid = (from cert in caCert
                                where cert.KeySerialNo == dogId
                                orderby cert.EnrollDate descending
                                select cert.EntityGuid).FirstOrDefault();
                user = (from u in dbUsers
                        join c in dbCorpInfo on u.UserGuid equals c.CorpUserGuid
                        where c.CorpGuid == corpGuid
                        select u).FirstOrDefault();
            }
            if (user != null)
            {
                var quality = dbQualities.Where(q => q.CorpUserGuid == user.UserGuid && q.IsMain == true).FirstOrDefault();

                if (quality != null)
                {
                    string message = string.Empty;
                    switch (user.RoleID)
                    {
                        case 105:
                        case 99105:
                            if (quality.KindID == 132)
                            {
                                bool isok = GradeCost(quality.GradeCode, objStr, out message);
                                if (isok)
                                {
                                    result.Message = message;
                                    result.Result = true;
                                }
                                else
                                {
                                    result.Message = message;
                                    result.Result = false;
                                }
                            }
                            break;
                        default:
                            break;
                    }
                }
            }
            return result;
        }

        private bool GradeCost(string gradecode, string objStr, out string message)
        {
            message = string.Empty;
            switch (gradecode)
            {
                case "1"://甲级工程招标代理机构可以承担各类工程的招标代理业务。
                    message = "您是甲级资质，可以承担各类工程的招标代理业务";
                    return true;
                case "2"://乙级工程招标代理机构只能承担工程总投资1亿元人民币以下的工程招标代理业务
                    message = "您是乙级资质，只能承担工程总投资1亿元人民币以下的工程招标代理业务";
                    if (Convert.ToDecimal(objStr) < 100000000)
                    {
                        return true;
                    }
                    else
                    {
                        return false;
                    }
                case "4"://暂定级工程招标代理机构，只能承担工程总投资6000万元人民币以下的工程招标代理业务
                    message = "您是暂定级资质，只能承担工程总投资6000万元人民币以下的工程招标代理业务";
                    if (Convert.ToDecimal(objStr) < 60000000)
                    {
                        return true;
                    }
                    else
                    {
                        return false;
                    }
                default:
                    break;
            }
            return false;
        }

        #endregion

        #region 根据省库keyID获取青岛的企业信息

        public virtual string GetCorpInfoForDL(string dogID, string areaCode)
        {
            return string.Empty;
        }

        #endregion

        public virtual bool IsUserExisted(string userName)
        {
            return false;
        }

        #region 企业注册
        public virtual DTO.OperationResult CorpReg(Tb_Corp_CompanyInfo corp, T_Sys_Users user)
        {
            return new DTO.OperationResult();
        }
        #endregion

        #region 修改企业信息
        public virtual DTO.OperationResult CorpEdit(DTO.Tb_Corp_CompanyInfo corpInfo, DTO.Kh_CorpTable khCorpTable, DTO.Tb_Corp_Embranchment embranchMent, string areaCode)
        {
            return new DTO.OperationResult();
        }

        public virtual DTO.OperationResult KH_CorpEdit(DTO.Kh_CorpTable khCorpTable, string areaCode)
        {
            return new DTO.OperationResult();
        }
        #endregion

        #region 查询企业市场范围信息
        public virtual List<DTO.Tb_Corp_Embranchment> GetCorpEmbranchments(DTO.Tb_Corp_CompanyInfo corpInfo)
        {
            return null;
        }
        #endregion

        #region 查询企业在当前市场范围审核状态
        public virtual DTO.Tb_FlowCode GetCorpFlowCode(DTO.Tb_Corp_CompanyInfo corpInfo, string areaCode)
        {
            return null;
        }
        #endregion

        /// <summary>
        /// 审核企业退回操作
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="areaCode"></param>
        /// <param name="log"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CorpAuditBack(string corpUserGuid, string areaCode, User_Log log)
        {
            return new DTO.OperationResult();
        }

        public virtual string GetCompanyinfoByZbdlDogid(int dogid)
        {
            return null;
        }

        #region 添加分支机构（市场范围）
        public virtual DTO.OperationResult EmbranchAdd(string corpUserGuid, string areaCode)
        {
            return new DTO.OperationResult();
        }
        #endregion

        #region 获取企业资质图片
        public virtual string GetCorpZZImages(IList<QueryCorpQualityInfoCondition> queryCondition, string areaCode)
        {
            return null;
        }
        #endregion

        #region 企业统计
        public virtual StatisticsStruct GetStatisticCorps(string areaCode, string flowCodes)
        {
            return null;
        }
        #endregion

        #region 获取企业考核分数
        public virtual List<e_SorcePublish_2006> GetCorpAssessInfo(string corpUserGuid, int bgrade, int bFlag)
        {
            return null;
        }
        #endregion

        #region 外网企业面板统计
        public virtual StatisCorpPanel GetCorpPanelInfo(StatisCorpPanel corpPanel)
        {
            return null;
        }
        #endregion

        #region 外网企业查询
        public virtual IList<CompanyInfo> GetPortalCorpList(IList<QueryPortalCompanyInfoCondition> queryCondition, int pageSize, int pageNum, string flowAreaCode)
        {
            return null;
        }
        public virtual int GetPortalCorpCount(IList<QueryPortalCompanyInfoCondition> queryCondition, string flowAreaCode)
        {
            return -1;
        }
        #endregion

        #region 校验企业是否可编辑状态
        public virtual DTO.OperationResult CheckCorpEditStatus(string corpUserGuid, string areaCode)
        {
            return new DTO.OperationResult();
        }

        public virtual DTO.OperationResult CheckSecurityEditStatus(string corpUserGuid, string areaCode)
        {
            return new DTO.OperationResult();
        }
        #endregion

        #region 根据企业类型获取企业考核结果
        /// <summary>
        /// 
        /// </summary>
        /// <param name="classId">企业类型</param>
        /// <param name="scoreType">奖惩类型0-扣分，1-加分，-1-全部</param>
        /// <param name="areaCode">地区</param>
        /// <returns></returns>
        public virtual List<DTO.CompanyInfo> GetItemBikedList(int pageSize,
            int pageNum,
            List<QueryCompanyInfoCondition> condition,
            string areaCode)
        {
            return null;
        }

        public virtual int GetItemBikedCount(List<QueryCompanyInfoCondition> condition, string areaCode)
        {
            return 0;
        }
        /// <summary>
        /// 专家列表获取
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageNum"></param>
        /// <param name="condition"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public virtual List<DTO.tb_emp_expert> GetEmpExpertList(int pageSize,
            int pageNum,
            List<QueryEmpExpertCondition> condition,
            string areaCode)
        {
            return null;
        }
        /// <summary>
        /// 专家总数
        /// </summary>
        /// <param name="condition"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public virtual int GetEmpExpertCount(
            List<QueryEmpExpertCondition> condition,
            string areaCode)
        {
            return 0;
        }
        #endregion


        #region 青岛招标代理系统首页企业、人员信息统计
        public virtual IList<CorpStatisModel> CorpStatis(string isNative, int roleid, int corpkindid, string areacode)
        {
            return null;
        }

        public virtual IList<CorpInfoModel> GetCorpList(string queryCondition, out int count, string areaCode)
        {
            count = 0;
            return null;
        }

        public virtual IList<CompanyInfo> GetZBDLCompanyInfo(QueryCompanyInfoConditionZBDL queryCondition, int pageSize, int pageNum, string areaCondition)
        {
            return null;
        }

        public class CorpInfoModel
        {
            public Guid CorpUserGuid { get; set; }
            public Int32? classID { get; set; }
            public String CorpName { get; set; }
            public String Address { get; set; }
            public String LinkMan1 { get; set; }
            public String Tel { get; set; }
            public String QualityName { get; set; }
            public String GradeCode { get; set; }
            public Int32? tb_Corp_IsOuter { get; set; }
            public Int32? KindID { get; set; }
            public String FlowCode { get; set; }
            public String DetailName { get; set; }
        }

        public class CorpStatisModel
        {
            public String GradeCode { get; set; }
            public Int32? Count { get; set; }
            public String GradeName { get; set; }
            public Int32? tb_Corp_IsOuter { get; set; }
        }
        #endregion

        #region 通知管理
        public virtual List<tb_Notice> GetNoticeList(out int count, int pageSize, int pageNum, List<QueryNoticeInfoCondition> condition, string areaCode)
        {
            count = 0;
            return new List<tb_Notice>();
        }
        public virtual tb_Notice GetNotice(string guid)
        {
            return new tb_Notice();
        }

        public virtual DTO.OperationResult SaveNoticeInfo(tb_Notice noticeModel)
        {
            return new DTO.OperationResult();
        }

        public virtual DTO.OperationResult DeleteNotice(string keyGuid)
        {
            return new DTO.OperationResult();
        }
        #endregion

        public virtual List<DTO.CorpBzjInfo> GetCorBzjList(out int count, int pageIndex, int pageSize, string condition, string areaCode)
        {
            count = 0;
            return null;
        }
        public virtual List<string> GetCorBzjGroupList(out int count, int pageIndex, int pageSize, string condition, string areaCode)
        {
            count = 0;
            return null;
        }
        public virtual List<h_ItemBiked> GetItemBikedByCorp(out int count, int pageIndex, int pageSize, string userguid)
        {
            count = 0;
            return null;
        }

        #region 获取企业在所有市场的状态
        public virtual List<FlowStatus> GetCorpFlowStatus(string corpUserGuid, string areaCode)
        {
            return null;
        }
        #endregion

        #region 公文新闻
        public virtual List<b_NewsTable> GetNewsList(
        out int count,
        int pageNum,
        int pageSize,
        List<QueryNewsInfoCondition> condition,
        string areaCode)
        {
            count = 0;
            return null;
        }

        public virtual b_NewsTable GetNewsInfo(int id)
        {
            return null;
        }

        public virtual DTO.OperationResult SaveNewsInfo(b_NewsTable newsModel)
        {
            return null;
        }

        public virtual DTO.OperationResult DeleteNews(int id)
        {
            return null;
        }

        #endregion

        #region 企业注册审核(烟台)
        public virtual List<CompanyInfo> GetCorpRegListYT(out int count, int pageNum, int pageSize, List<QueryCompanyInfoCondition> condition, string areaCode, string flowClassId, string roleId)
        {
            count = 0;
            return null;
        }
        public virtual DTO.OperationResult CorpRegAudit(string corpUserGuid
        , string areaCode
        , User_Log log
        , string flowCode
        , string description
        , bool isFinal
        , string classId)
        {
            return null;
        }

        public virtual List<CompanyInfo> GetManagerRegListYT(out int count, int pageNum, int pageSize, List<QueryCompanyInfoCondition> condition, string areaCode)
        {
            count = 0;
            return null;
        }

        public virtual DTO.OperationResult ManagerRegAudit(string userGuid
       , string areaCode
       , User_Log log
       , string flowCode
       , string description
       , bool isFinal)
        {
            return null;
        }
        #endregion

        /// <summary>
        /// 企业锁定解锁
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="bCanBid"></param>
        /// <param name="type">0解锁，1锁定</param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult SetCorpbCanBid(string corpUserGuid, string bCanBid, string areaCode)
        {
            return null;
        }

        public virtual void GenerateFlowCodebyAppId(string userGuid, int appID, string areaCode)
        {
        }

        #region 咨询互动(烟台门户)
        public virtual void AddConsultation(zb_Consultation submitInfo)
        {

        }

        public virtual List<T_Sys_Users> GetConsultationUser(string roleValue, string areaCode)
        {
            return null;
        }

        public virtual List<RN.ERP.Entity.ZBDLRY.zb_Consultation> GetPortalQuestionList(string isAnswer, string type, string userGuid, string role, int pageSize, int pageIndex, string areaCode)
        {
            return null;
        }

        public virtual int GetPortalQuestionCount(string isAnswer, string type, string userGuid, string role, string areaCode)
        {
            return 0;
        }

        public virtual RN.ERP.Entity.ZBDLRY.zb_Consultation GetPortalQuestion(string id, string areaCode)
        {
            return null;
        }

        public virtual List<RN.ERP.Entity.ZBDLRY.zb_Consultation_Answer> GetPortalAnswerList(string id, int pageSize, int pageIndex, string areaCode)
        {
            return null;
        }

        public virtual int GetPortalAnswerCount(string id, string areaCode)
        {
            return 0;
        }

        public virtual string GetQuestionUser(string userGuid, string areaCode)
        {
            return string.Empty;
        }

        public virtual void AddConsultationAnswer(zb_Consultation_Answer submitInfo, string areaCode)
        {

        }
        public virtual List<b_NewsTable> GetUploadPicList(string areaCode)
        {
            return null;
        }

        public virtual List<string> GetPersonByKeyGuid(string keyGuid, string areaCode)
        {

            return null;
        }
        #endregion

        public virtual List<ProgressNode> GetProgressNodes(string classId, string areaCode, string flowCode)
        {

            return null;
        }


        #region 考核获取企业信息 2014-5-14 毛凯
        public virtual DTO.CompanyBusinessInfoKH GetCompanyBusinessInfoKH(string corpUserGuid, string snapGuid, string areaCode)
        {
            return null;
        }
        #endregion

        #region 考核企业附属信息 编辑 2014-5-15 毛凯
        /// <summary>
        /// 资金及经营情况编辑
        /// </summary>
        /// <param name="capitalBusinessKH"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CompanyAttchInfoKHEdit(
            string corpUserGuid,
            string capitalBusinessKH,
            string projectAchieveMentKH,
            string areaCode)
        {
            return null;
        }
        #endregion

        #region  查询企业资质
        public virtual IList<CompanyInfo> GetCorpLists(IList<QueryCompanyInfoCondition> queryCondition, int pageIndex, int pageSize, out int count, string areaCode)
        {
            count = 0;
            return null;
        }
        #endregion

        public virtual DTO.OperationResult IsUrban(string userGuid)
        {
            return null;
        }

        #region 企业注册审核(聊城)
        public virtual List<CompanyInfo> GetCorpRegListLC(out int count, int pageNum, int pageSize, List<QueryCompanyInfoCondition> condition, string areaCode)
        {
            count = 0;
            return null;
        }
        #endregion

        public virtual IList<CompanyInfo> GetCorpListByGroupID(
        IList<QueryCompanyInfoCondition> queryCondition,
        int pageSize,
        int pageNum,
        string areaCondition,
        int groupId,
        out int cnt)
        {
            cnt = 0;
            return null;
        }

        public virtual IList<CompanyInfo> GetCorpPostInfoList(
        IList<QueryCompanyInfoCondition> queryCondition,
        int pageSize,
        int pageNum,
        string areaCondition,
        int groupId,
        out int cnt)
        {
            cnt = 0;
            return null;
        }

        #region 企业组织机构代码修改(聊城)
        /// <summary>
        /// 企业获取组织机构代码信息
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="areaCode"></param>
        /// <param name="codeType"></param>
        /// <param name="appID"></param>
        /// <returns></returns>
        public virtual DTO.Tb_FlowCode GetCorpOrgByCorpUserGuid(string corpUserGuid, string areaCode, int codeType, int appID)
        {
            return null;
        }
        /// <summary>
        /// 企业上报申请修改组织机构代码
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="areaCode"></param>
        /// <param name="codeType"></param>
        /// <param name="appID"></param>
        /// <param name="optType"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CorpOrgPost(string orgCode, string corpUserGuid, string orgGuid, string areaCode, int codeType, int appID, int optType)
        {
            return null;
        }
        /// <summary>
        /// 主管获取组织机构代码列表
        /// </summary>
        /// <param name="queryCondition"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageNum"></param>
        /// <param name="areaCode"></param>
        /// <param name="codeType"></param>
        /// <param name="appID"></param>
        /// <param name="cnt"></param>
        /// <returns></returns>
        public virtual IList<DTO.Tb_FlowCode> GetCorpOrgList(
            string curFlowcode,
            string corpName,
            int pageSize,
            int pageNum,
            string areaCode,
            int codeType,
            int appID,
            out int cnt)
        {
            cnt = 0;
            return null;
        }

        /// <summary>
        /// 主管审核组织机构代码变更
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="areaCode"></param>
        /// <param name="codeType"></param>
        /// <param name="appID"></param>
        /// <param name="optType"></param>
        /// <returns></returns>
        public virtual DTO.OperationResult CorpOrgAudit(List<string> corpUserGuid, string roleID, string areaCode, int codeType, int appID, int optType)
        {
            return null;
        }
        #endregion
    }
}
